﻿@model IEnumerable<GroupEntity>
@{
    IUser currentUser = UserContext.CurrentUser;
}
<a class="spb-menu-link" href="@SiteUrls.Instance().ChannelGroupHome()">商户</a>
@if (currentUser != null)
{
    <ul class="tn-widget-content tn-border-gray spb-group-menu">
        <li class="tn-title tn-border-gray tn-border-bottom"><a href="@SiteUrls.Instance().FindGroup()">
            发现商户</a><strong>我的商户</strong></li>
        @if (Model != null && Model.Count() > 0)
        {
            foreach (var item in Model)
            { 
            <li class="tn-person">
                <div class="tn-avatar">
                    <a href="@SiteUrls.Instance().GroupHome(item.GroupKey)" title="@item.GroupName" >
                        <img alt="@item.GroupName" title="@item.GroupName" src="@SiteUrls.Instance().LogoUrl(item.Logo, TenantTypeIds.Instance().Group(), ImageSizeTypeKeys.Instance().Medium())" width="50" height="50"/>
                    </a>
                </div>
                <a href="@SiteUrls.Instance().GroupHome(item.GroupKey)"  class="tn-name">@item.GroupName</a>
            </li> 
            }
        }
        else
        {
            <li class="tn-no-data">您还没有加入任何商户，到<a href="@SiteUrls.Instance().ChannelGroupHome()">商户首页</a>逛逛吧。</li>
        }
        <li class="tn-actions tn-border-gray tn-border-top"><a href="@SiteUrls.Instance().CreateGroup()">
            创建商户</a><a href="@SiteUrls.Instance().UserJoinedGroups(UserContext.CurrentUser.UserName)">查看我的商户</a></li>
    </ul>
}
